package p14.p1410;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexDemo {
    public static void main(String[] args) {
        //Pattern p = Pattern.compile("a*b");
        //Matcher m = p.matcher("aab");

        //Matcher m = (Pattern.compile("a*b")).matcher("aa*b");

        //boolean b = m.matches();
        boolean b = ((Pattern.compile("a*b")).matcher("aab")).matches();
        System.out.println(b);
        System.out.println(((Pattern.compile("a*b")).matcher("aab")).matches());

        System.out.println("----");
        //String s = "aaaab";
        String regex = "a*b";
        System.out.println("aaab".matches("a*b"));



    }
}
